package com.lzp.copyui.design

import android.os.Bundle
import com.base.BaseActivity
import com.google.android.material.shape.CornerFamily
import com.google.android.material.shape.RelativeCornerSize
import com.google.android.material.shape.ShapeAppearanceModel
import com.lzp.copyui.R
import kotlinx.android.synthetic.main.design_view_activity.*

class ShapeImageViewActivity :BaseActivity(){
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.design_view_activity)
    }

    override fun initView() {
        super.initView()
        iv1.shapeAppearanceModel = ShapeAppearanceModel.builder()
                .setTopLeftCorner(CornerFamily.ROUNDED, RelativeCornerSize(0.3f))
                .setTopRightCorner(CornerFamily.ROUNDED,RelativeCornerSize(0.3f))
                .setBottomRightCorner(CornerFamily.ROUNDED,RelativeCornerSize(0.3f))
                .setBottomLeftCorner(CornerFamily.ROUNDED,RelativeCornerSize(0.3f))
                .build()


        iv2.shapeAppearanceModel = ShapeAppearanceModel.builder()
                .setTopLeftCorner(CornerFamily.ROUNDED, RelativeCornerSize(0.5f))
                .setTopRightCorner(CornerFamily.ROUNDED,RelativeCornerSize(0.5f))
                .setBottomRightCorner(CornerFamily.ROUNDED,RelativeCornerSize(0f))
                .setBottomLeftCorner(CornerFamily.ROUNDED,RelativeCornerSize(0f))
                .build()

        iv3.shapeAppearanceModel = ShapeAppearanceModel.builder()
                .setTopLeftCorner(CornerFamily.CUT, RelativeCornerSize(0.5f))
                .setTopRightCorner(CornerFamily.ROUNDED,RelativeCornerSize(0f))
                .setBottomRightCorner(CornerFamily.ROUNDED,RelativeCornerSize(0f))
                .setBottomLeftCorner(CornerFamily.ROUNDED,RelativeCornerSize(0f))
                .build()

        iv4.shapeAppearanceModel = ShapeAppearanceModel.builder()
                .setTopLeftCorner(CornerFamily.ROUNDED, RelativeCornerSize(0.5f))
                .setTopRightCorner(CornerFamily.ROUNDED,RelativeCornerSize(0.5f))
                .setBottomRightCorner(CornerFamily.ROUNDED,RelativeCornerSize(0.5f))
                .setBottomLeftCorner(CornerFamily.ROUNDED,RelativeCornerSize(0.5f))
                .build()

        iv5.shapeAppearanceModel = ShapeAppearanceModel.builder()
                .setTopLeftCorner(CornerFamily.CUT, RelativeCornerSize(0.5f))
                .setTopRightCorner(CornerFamily.CUT,RelativeCornerSize(0.5f))
                .setBottomRightCorner(CornerFamily.CUT,RelativeCornerSize(0.5f))
                .setBottomLeftCorner(CornerFamily.CUT,RelativeCornerSize(0.5f))
                .build()

        iv6.shapeAppearanceModel = ShapeAppearanceModel.builder()
                .setTopLeftCorner(CornerFamily.CUT, RelativeCornerSize(0f))
                .setTopRightCorner(CornerFamily.CUT,RelativeCornerSize(0.5f))
                .setBottomRightCorner(CornerFamily.CUT,RelativeCornerSize(0f))
                .setBottomLeftCorner(CornerFamily.CUT,RelativeCornerSize(0.5f))
                .build()

        iv7.shapeAppearanceModel = ShapeAppearanceModel.builder()
                .setTopLeftCorner(CornerFamily.ROUNDED, RelativeCornerSize(0.5f))
                .setTopRightCorner(CornerFamily.CUT,RelativeCornerSize(0f))
                .setBottomRightCorner(CornerFamily.CUT,RelativeCornerSize(0f))
                .setBottomLeftCorner(CornerFamily.CUT,RelativeCornerSize(0f))
                .build()

        iv8.shapeAppearanceModel = ShapeAppearanceModel.builder()
                .setTopLeftCorner(CornerFamily.CUT, RelativeCornerSize(0.25f))
                .setTopRightCorner(CornerFamily.CUT,RelativeCornerSize(0.25f))
                .setBottomRightCorner(CornerFamily.CUT,RelativeCornerSize(0.25f))
                .setBottomLeftCorner(CornerFamily.CUT,RelativeCornerSize(0.25f))
                .build()
    }
}
